<template>
  <div>
    <el-card class="box-1">
      <div slot="header"><span>业绩订单详情</span></div>
      <el-form :model="form" label-width="160px">
        <el-form-item label="业绩订单号">
          {{ form['number_sn'] }}
        </el-form-item>
        <el-form-item label="审核人员">
          {{ form['verify_user_name'] }}
        </el-form-item>
        <el-form-item label="审核时间">
          {{ form['verify_time'] }}
        </el-form-item>
        <el-form-item label="客户名称">
          {{ form['member_name'] }}
        </el-form-item>
        <el-form-item label="客户手机">
          {{ form['member_phone'] }}
        </el-form-item>
        <el-form-item label="公司名称">
          {{ form['company'] }}
        </el-form-item>
        <el-form-item label="职位">
          {{ form['position'] }}
        </el-form-item>
        <el-form-item label="腾讯云ID">
          {{ form['qq'] }}
        </el-form-item>
        <el-form-item label="微信号">
          {{ form['wechat'] }}
        </el-form-item>
        <el-form-item label="提交人">
          {{ form['admin_name'] }}
        </el-form-item>
        <el-form-item label="商品名称">
          {{ form['goods_name'] }}
        </el-form-item>
        <el-form-item label="商品原价">
          ￥{{ form['goods_price'] }}
        </el-form-item>
        <el-form-item label="实际销售价">
          ￥{{ form['goods_money'] }}
        </el-form-item>
        <el-form-item label="是否参与业绩计算">
          {{ form['ach_state_text'] }}
        </el-form-item>
        <el-form-item label="是否创建售后订单">
          {{ form['sale_order'] }}
        </el-form-item>
        <el-form-item label="提成规则">
          {{ form['ruleName'] }}
        </el-form-item>
        <el-form-item label="提成方式">
          {{ form['ruleMode'] }}
        </el-form-item>
        <el-form-item label="计算规则">
          {{ form['ruleCompute'] }}
        </el-form-item>
        <el-form-item label="合计金额">
          ￥{{ form['total_bonus'] }}
        </el-form-item>
        <el-form-item label="销售提成">
          ￥{{ form['after_money'] }}
        </el-form-item>
        <el-form-item label="预期奖金">
          ￥{{ form['bonus_royalty'] }}
        </el-form-item>
        <el-form-item label="订单号" prop="order_num">
          <el-input v-model="form['order_num']" readonly/>
        </el-form-item>
        <el-form-item label="购买时间">
          <el-date-picker v-model="form['buy_time']" value-format="yyyy-MM-dd" type="date" placeholder="选择日期" readonly/>
        </el-form-item>
        <el-form-item label="购买时长" prop="term">
          <el-input v-model="form['buy_length']" readonly/>
          <div class="remark">*注:时长是按月计算</div>
        </el-form-item>
        <el-form-item label="备注(拒绝备注)">
          <el-input v-model="form['remarks']" type="textarea" rows="4" readonly/>
        </el-form-item>
        <el-form-item label="销售凭证" prop="title">
          <div class="remark">*注:最多传三张图</div>
          <!--<ws-upload-multiple-img :path="form['pic_list_url']" :disable="true"/>-->
          <div class="flex-row">
            <el-image
              v-for="item in form['sale_proof']" :key="item"
              :src="item"
              :preview-src-list="form['sale_proof']"
              style="width: 100px; height: 100px;margin-right: 20px;"/>
          </div>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        title: '',
        // imageUrl: this.$store.getters.serverUrl,
        imageUrl: '',
        form: {
          pic_list_url: []
        }
      }
    },
    watch: {},
    created() {
      this.id = this.$route.query.id
      this.getData()
    },
    methods: {
      getData() {
        const url = 'achievement/detail/' + this.id
        this.$store.dispatch('GetConnect', { url }).then(res => {
          this.form = res.data
          this.form.pic_list_url = []
          res.data.sale_proof.forEach(item => {
            this.form.pic_list_url.push({ id: item, 'url': this.imageUrl + item })
          })
        }).catch(e => {
          this.$message.error(e.msg + ',请刷新或联系管理员')
        })
      }
    }
  }
</script>

<style lang="scss" type="text/scss" scoped>
  @import '../../../styles/index.scss';

  .box-1 {
    max-width: 1000px;
    margin: 0 auto;

    > div span {
      font-size: 18px;
      font-weight: 600;
      padding: 0 10px;
    }

    .el-form {
      max-width: 900px;

      .title {
        font-weight: 600;
      }

      .remark {
        font-size: 13px;
        color: $textGray;
      }

      .el-button {
        @extend .bg-green;
        width: 20%;
        min-width: 160px;
      }
    }
  }

  .el-checkbox {
    margin-right: 30px;
  }

  .el-checkbox + .el-checkbox {
    margin-left: 0;
    margin-right: 30px;
  }
</style>
